package com.bwie.controller;

import com.bwie.service.TbUserService;
import com.bwie.utils.R;
import com.bwie.vo.LoginInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * description:
 *
 * @Author caoshuaifeng
 * @Create 2025/4/17 9:33
 * @Version 1.0
 */
@RestController
@RequestMapping("/user/index")
public class IndexController {

    @Autowired
    TbUserService tbUserService;


    /**
     * 登录
     * @return
     */
    @PostMapping("/login")
    public R login(@RequestBody LoginInfoVo loginInfoVo){
       return tbUserService.login(loginInfoVo);
    }
    /**
     * 查询管理员信息
     *
     */

    @PostMapping("/getUserById/{userId}")
    public R getUserById(@PathVariable("userId") Integer userId){
        return tbUserService.getUserById(userId);

    }
}
